package com.wikidot.designpatterns.builder;

/**
 * Concrete builder.
 */
class CompanyTwoLabelBuilder extends LabelBuilder {
	public void setDescription(String description) {
		this.label.setDescription(description);
	}

	/**
	 * Label ID is constructed as group of capital 3 letters followed by group
	 * of 6 numbers. The separator is dash.
	 */
	public void setId(String id) {

		if ((id.length() % 3) != 0) {
			System.out.println("Invalid ID: " + id);
		}
		StringBuilder targetId = new StringBuilder();
		targetId.append(id.substring(0, 3));
		targetId.append("-");
		targetId.append(id.substring(3, 9));

		this.label.setId(targetId.toString());
	}

	public void setTag(String tag) {
		this.label.setTag(tag);
	}
}
